import Vue from 'vue';
import VueRouter from 'vue-router';
import temp from '../views/temp.vue';
import indexPage from './module/indexPage.js';//模板页
import componentPage from './module/componentPage.js';//组件页
import userPage from './module/userPage.js';//个人页
import routerHelper from './routerHelper.js';//导航助手

Vue.use(VueRouter);
const routes = [
   {
      path: '/',
      name: 'index',
      meta: {
         keepAlive: true,
      },
      component: () => import('@/views/index.vue'),
   },
   {
      path: '/index',
      name: 'index',
      component: temp,
      children: indexPage,
   },
   {
      path: '/component',
      name: 'component',
      component: temp,
      children: componentPage,
   },
   {
      path: '/user',
      name: 'user',
      component: temp,
      children: userPage,
   }
];

const router = new VueRouter({
   mode: 'hash',
   base: process.env.BASE_URL,
   routes
});
routerHelper(router);
export default router;
